package com.ruoyi.livesass;

import java.util.List;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.volcengine.error.SdkError;
import com.volcengine.helper.Const;
import com.volcengine.helper.Utils;
import com.volcengine.model.livesaas.request.CommonRequest;
import com.volcengine.model.livesaas.request.CreateActivityAPIRequest;
import com.volcengine.model.livesaas.request.GetLiveTrafficPostPayDataRequest;
import com.volcengine.model.livesaas.request.ListActivityAPIRequest;
import com.volcengine.model.livesaas.response.CreateActivityAPIResponse;
import com.volcengine.model.livesaas.response.GetActivityAPIResponse;
import com.volcengine.model.livesaas.response.GetAllStreamPullInfoAPIResponse;
import com.volcengine.model.livesaas.response.GetLiveTrafficPostPayDataResponse;
import com.volcengine.model.livesaas.response.ListActivityAPIResponse;
import com.volcengine.model.response.RawResponse;
import com.volcengine.model.response.ResponseMetadata;
import com.volcengine.service.livesaas.LivesaasService;
import com.volcengine.service.livesaas.impl.LivesaasServiceImpl;


public class TestYb {
	
	
	public static void main(String[] args) {
        LivesaasService livesaasService = LivesaasServiceImpl.getInstance();
        // call below method if you dont set ak and sk in ～/.volc/config

        livesaasService.setAccessKey("AKLTZDVmMmY3YzcxNTcxNDYwMWFlOTgwMTE1NTBhYjI2Yjg");
        livesaasService.setSecretKey("WkdWbE1HUXdZbVpoTmpaaE5ETmpNV0V6TTJFMk9XVmtObU16TVdZNU56SQ==");
        // list users
        
        
        //CreateActivityAPIV2
        
        //livesaasService.createActivityAPIV2(null);
        
        try {
            //CommonRequest commonAPIRequest = new CommonRequest();
            //commonAPIRequest.setActivityId(1823385199651114L);
            
            
            
            CreateActivityAPIRequest caar = new CreateActivityAPIRequest();
            caar.setName("api创建直播间04");
            caar.setCreatorName("dfhuf520@126.com");
            
            
            //普通延迟
            caar.setLiveMode(2);
            
            //直播布局 纯视频
            caar.setLiveLayout(2);
            

            //GetActivityAPIResponse getActivityAPIResponse = livesaasService.getActivityAPI(commonAPIRequest);
            //System.out.println(JSON.toJSONString(getActivityAPIResponse));
            
            
            
            //CreateActivityAPIResponse createActivityAPIResponse = livesaasService.createActivityAPIV2(caar);
            //System.out.println(JSON.toJSONString(createActivityAPIResponse));
            
            
            //ListActivityAPIResponse listActivityAPIResponse = livesaasService.listActivityAPI(new ListActivityAPIRequest());
            // 
            
            //System.out.println(JSON.toJSONString(listActivityAPIResponse));
            
            
            /**/
            GetLiveTrafficPostPayDataRequest getLiveTrafficPostPayDataRequest = new GetLiveTrafficPostPayDataRequest();
            List<Long> ids =  Lists.newArrayList();
            ids.add(1823474935011360L);

            getLiveTrafficPostPayDataRequest.setStartDay("20250110");
            getLiveTrafficPostPayDataRequest.setEndDay("20250209");
            getLiveTrafficPostPayDataRequest.setActivityIds(ids);
            
            
            GetLiveTrafficPostPayDataResponse getLiveTrafficPostPayDataResponse = livesaasService.getLiveTrafficPostPayData(getLiveTrafficPostPayDataRequest);
            
            
            System.out.println(JSON.toJSONString(getLiveTrafficPostPayDataResponse));
            
            
            
            
            /*
            ListActivityAPIRequest listActivityAPIRequest = new ListActivityAPIRequest();
            
            
            
            
            ListActivityAPIResponse listActivityAPIResponse = livesaasService.listActivityAPI(listActivityAPIRequest);
            System.out.println(JSON.toJSONString(listActivityAPIResponse));
            
            CommonRequest commonAPIRequest = new CommonRequest();
    		commonAPIRequest.setActivityId(1823474935011360L);

    		
    		GetAllStreamPullInfoAPIResponse getAllStreamPullInfoAPIResponse = livesaasService.getAllStreamPullInfoAPI(commonAPIRequest);

    		System.out.println(JSON.toJSONString(getAllStreamPullInfoAPIResponse));*/
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
	
	
	
	
}
